package com.backedserver.base;

import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;

/**
 * @author johnny
 * @create 2020-06-29 下午5:58
 **/
public class CaffeineUtils {


    static Cache<String, String> cache = Caffeine.newBuilder()
            .expireAfterAccess(240, TimeUnit.MINUTES)
            .maximumSize(10000).build();

    public static Cache<String, String> getTokenCache() {
        return cache;
    }

    static Map<String, String> cache2 = new HashMap<>();

    public static Map<String, String> getTokenCache2() {
        return cache2;
    }


}